//package com.studerb.service;
//
//import org.apache.log4j.Logger;
//import org.springframework.context.ApplicationContext;
//import org.springframework.context.ApplicationContextAware;
//import org.springframework.context.support.AbstractApplicationContext;
//
//import com.studerb.exceptions.ServiceException;
//import com.studerb.service.interfaces.IService;
//
///**
// * Base abstract class from which all services extend. Gives default methods for
// * start(), stop() which subclasses should override. Contains a standard Log4j
// * logger that all subclasses inherit
// * 
// * @param <T>
// *            concrete service type
// */
//public abstract class ServiceImp<T> implements IService, ApplicationContextAware {
//	protected Class<T> actualClass;
//	protected Logger logger = Logger.getLogger(this.getClass());
//	protected boolean started = false;
//	protected AbstractApplicationContext applicationContext;
//
//	public void start() {
//		if (started) {
//			throw new ServiceException("Trying to start already started service");
//		}
//		logger.debug("Starting " + this.getClass().getName() + " service...");
//		started = true;
//	}
//
//	public void stop() {
//		if (!started) {
//			throw new ServiceException("Trying to stop already stopped service");
//		}
//		logger.debug("Stopping " + this.getClass().getName() + " service...");
//		started = false;
//	}
//
//	public Object clone() throws CloneNotSupportedException {
//		throw new CloneNotSupportedException("Services cannot be cloned");
//	}
//
//	public boolean isStarted() {
//		return started;
//	}
//
//	public void setApplicationContext(ApplicationContext applicationContext) {
//		this.applicationContext = (AbstractApplicationContext)applicationContext;
//	}
//}
